package com.yxh.www.author.controller;


import com.yxh.www.author.api.AuthorSmServerApiApi;
import com.yxh.www.author.domain.SmServerApi;
import com.yxh.www.author.service.SmServerApiService;
import com.yxh.www.common.result.Result;

import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 系统接口资源表 前端控制器
 * </p>
 *
 * @author Yangxiaohui
 * @since 2020-05-09
 */
@Api(tags = "系统接口资源管理")
@RestController
public class SmServerApiController implements AuthorSmServerApiApi {

    private final SmServerApiService smServerApiService;

    public SmServerApiController(SmServerApiService smServerApiService) {
        this.smServerApiService = smServerApiService;
    }

    /**
     * 根据第三方账户ID 获取可访问接口列表
     *
     * @param smAccountId 第三方账户ID
     * @return 统一响应 {@link Result<List>} 实体类型 {@link SmServerApi}
     */
    @Override
    public Result<List<SmServerApi>> listSmServerApiBySmAccountId(String smAccountId) {
        return smServerApiService.listSmServerApiBySmAccountId(smAccountId);
    }
}
